package service

import (
	"bgs/cache/redisImp"
	"bgs/conf"
	"bgs/db"
	"bgs/grpc/client"
	orderRunner "bgs/nsqp/runners/order"
	"go.uber.org/zap"
)

// OrderServiceImp order bizlogic
type OrderServiceImp struct {
	dao         *db.PgDao
	slog        *zap.SugaredLogger
	vars        *conf.VarsSection
	proxy       *client.GrpcClientProxy
	cacher      *cache.Adapter
	orderRunner *orderRunner.NsqOrderRunner
}

// NewOrderService initialization
func NewOrderService(
	pgdao *db.PgDao,
	slog *zap.SugaredLogger,
	vars *conf.VarsSection,
	proxy *client.GrpcClientProxy,
	adp *cache.Adapter,
	orderRunner *orderRunner.NsqOrderRunner,
) *OrderServiceImp {
	return &OrderServiceImp{
		dao:         pgdao,
		slog:        slog.With("module", "OrderService"),
		vars:        vars,
		proxy:       proxy,
		cacher:      adp,
		orderRunner: orderRunner,
	}
}
